package com.ytkj.digitalConstruction.dao.message;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.ytkj.digitalConstruction.entity.message.MessageUser;
import com.ytkj.digitalConstruction.httpbean.message.resbean.MessageDetails;

/**
 * 消息用户关联Mapper
 * @author iking
 *
 */
@Mapper
public interface MessageUserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(MessageUser record);

    int insertSelective(MessageUser record);

    MessageUser selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(MessageUser record);

    int updateByPrimaryKey(MessageUser record);

	/**
	 * @param statusCode
	 * @param messageId 
	 * @param userIdList
	 * @return
	 */
	int updateStatusByMessageIdAndUserIds(@Param("statusCode")Integer statusCode, @Param("messageId")Integer messageId, @Param("userIdList")List<Integer> userIdList);

	/**
	 * @param statusCode
	 * @param messageId
	 * @return
	 */
	int updateStatusByMessageId(@Param("statusCode")Integer statusCode,@Param("messageId") Integer messageId);

	/**
	 * @desc 查询消息下用户阅读的详情
	 * @param id
	 * @return
	 */
	List<MessageDetails> selectDetailsByMessageId(Integer messageId);

	/**
	 * @param messageId 消息id
	 * @param statusCode 状态码
	 * @return
	 */
	List<MessageUser> selectByMessageIdAndStatus(@Param("messageId")Integer messageId, @Param("statusCode")Integer statusCode);
	
}